import { Injectable, OnModuleInit } from '@nestjs/common';
import { io, Socket } from 'socket.io-client';

@Injectable()
export class SocketClient implements OnModuleInit {
  public socketClient: Socket;

  constructor() {
    this.socketClient = io('http://localhost:9999');
  }
  onModuleInit() {
    this.registerConsumerEvent();
  }
  private registerConsumerEvent() {
    this.socketClient.on('connect', () => {});
    this.socketClient.on('onMessage', () => {
      console.log('socketClientClass');
    });
  }
}
